package com.wallellen.android.currencies;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

/**
 * Created by walle on 1/13/16.
 */
public class PrefsMgr {
    public static void setString(Context context, String locale, String code) {
        SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
        SharedPreferences.Editor edit = sharedPreferences.edit();
        edit.putString(locale, code);
        edit.commit();
    }

    public static String getString(Context context, String locale) {
        SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
        return sharedPreferences.getString(locale, null);
    }
}
